Repository navigation
[Test] Make the Hydra config tests pass on pytest 9.2 - #4640
Merged
bsprenger merged 1 commit intoOct 30, 2026
Merged
Conversation
pytest 9.2 deprecates module-scoped fixtures defined as instance methods. test_configs.py turns every warning into an error, so that warning from init_hydra made all 21 TestHydraParsing tests error at setup on Python 3.10 to 3.13. Make the fixture a classmethod, as pytest suggests. It does not use self.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4640
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 3 Cancelled JobsAs of commit 9c541a2 with merge base fd8b9d4 ( NEW FAILURE - The following job has failed:
CANCELLED JOBS - The following jobs were cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
bsprenger
approved these changes
Oct 30, 2026
bsprenger
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @peterdsharpe 🫶 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since pytest 9.2.0 came out on 2026-10-27, all 21
TestHydraParsingtests intest/test_configs.pyerror at setup on Python 3.10 to 3.13. That fails the CPUbulkjobs on main (tests-cpu (3.10, bulk)) and on every open PR. Python 3.14 passes only because the class is skipped there.pytest 9.2 deprecates module-scoped fixtures defined as instance methods, with a
PytestRemovedIn10Warning.init_hydrais one of them, andtest_configs.pyturns every warning into an error (pytestmark = pytest.mark.filterwarnings("error")). This PR makesinit_hydraa classmethod, as the warning suggests. The fixture does not useself.Checked locally on CPU with Python 3.12, tensordict main and
BATCHED_PIPE_TIMEOUT=60, as in CI. With pytest 9.2.0, main gives 21 errors at setup and this branch passes all 21 tests. With pytest 9.1.1, this branch passes all 21 too.Other fixtures in the test suite are written the same way. They only warn, because their files do not turn warnings into errors.
Motivation and Context
No issue raised: the change only touches one test fixture, and the CI logs show the failures.
Types of changes
Checklist